Skip to content

发起异常退款

提交退款申请后,查询退款确认状态为退款异常,可调用此接口发起异常退款处理。支持退款至用户、退款至交易商户银行账户两种处理方式。

请求参数类型描述
refund_idstring微信退款单号
jsonobject声明请求的JSON数据结构
sub_mchidstring二级商户号
individual_auth_idstring个人收款方受理授权ID
out_refund_nostring商户退款单号
typestring异常退款处理方式
USER_BANK_CARD | MERCHANT_BANK_CARD 枚举值之一
bank_typestring开户银行
CMB_DEBIT | COMM_DEBIT | ABC_DEBIT | CCB_DEBIT | ICBC_DEBIT | BOC_DEBIT | PAB_DEBIT | SPDB_DEBIT | CITIC_DEBIT | CEB_DEBIT | CMBC_DEBIT | CIB_DEBIT | GDB_DEBIT | PSBC_DEBIT | NBCB_DEBIT 枚举值之一
bank_accountstring收款银行卡号
real_namestring收款用户姓名
headersobject声明请求的头参数
Wechatpay-Serialstring平台公钥ID/平台公钥证书序列号
php
$instance->v3->ecommerce->refunds->_refund_id_->applyAbnormalRefund->postAsync([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/refunds/{refund_id}/apply-abnormal-refund')->postAsync([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/refunds/{refund_id}/apply-abnormal-refund']->postAsync([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->refunds->_refund_id_->applyAbnormalRefund->post([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/refunds/{refund_id}/apply-abnormal-refund')->post([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/refunds/{refund_id}/apply-abnormal-refund']->post([
  'refund_id' => '50000000382019052709732678859',
  'json' => [
    'sub_mchid' => '1900000109',
    'individual_auth_id' => '1900000109',
    'out_refund_no' => '1217752501201407033233368018',
    'type' => 'USER_BANK_CARD',
    'bank_type' => 'ICBC_DEBIT',
    'bank_account' => 'd+xT+MQCvrLHUVDWv/8MR/dB7TkXLVfSrUxMPZy6jWWYzpRrEEaYQE8ZRGYoeorwC+w==',
    'real_name' => 'UPgQcZSdq3zOayJwZ5XLrHY2dZU1W2Cd',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
refund_idstring微信支付退款号
out_refund_nostring商户退款单号
transaction_idstring微信支付订单号
out_trade_nostring商户订单号
channelstring退款渠道
user_received_accountstring退款入账账户
success_timestring退款成功时间
create_timestring退款创建时间
statusstring退款状态
funds_accountstring资金账户
amountobject金额信息
refundnumber退款金额
fromobject[]退款出资账户及金额
accountstring出资账户类型
amountnumber出资金额
payer_refundnumber用户退款金额
discount_refundnumber优惠退款金额
currencystring退款币种
refund_feenumber手续费退款金额
promotion_detailobject[]优惠退款信息
promotion_idstring券ID
scopestring优惠范围
typestring优惠类型
amountnumber优惠券面额
refund_amountnumber优惠退款金额
goods_detailobject[]商品列表
merchant_goods_idstring商户侧商品编码
wechatpay_goods_idstring微信侧商品编码
goods_namestring商品名称
unit_pricenumber商品单价
refund_amountnumber商品退款金额
refund_quantitynumber商品退货数量
refund_accountstring退款出资商户
REFUND_SOURCE_PARTNER_ADVANCE | REFUND_SOURCE_SUB_MERCHANT 枚举值之一

参阅 官方文档

Published on the GitHub by TheNorthMemory